package com.yang.FileController;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.File;
import java.io.IOException;

/**
 * java 模拟测试多线程测试http请求
 *
 * @author wdh
 */
@RestController
@RequestMapping("/f1")
public class FileController {

    @PostMapping("/f2")
    public String queryDetailData() throws InterruptedException, IOException {
        Thread.sleep(60000);
        long l = System.currentTimeMillis();
        File file = new File("C:\\Users\\Administrator\\Desktop\\2\\" + l+Math.random() + ".txt");
        file.createNewFile();
        System.out.println(Thread.currentThread().getName());
        return "ok";
    }
}
